package com.thinkcube.edutainment.fragment;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EFragment;

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.thinkcube.edutainment.R;

@EFragment(R.layout.message_main)
public class MessageMainFragment extends Fragment {

	 @Override
	 public View onCreateView(LayoutInflater inflater, ViewGroup container,
	   Bundle savedInstanceState) {
	 
	  
	  return null;
	 }
	 
	 /*add Ui components to content view*/
	 @AfterViews
	 void doUi()
	 {
		 setNavigationBar();
		 addInboxFragment();
	 }
	 
	 
	/*add messages navigation bar into main fragment */
	 void setNavigationBar()
	 {
		
		FragmentTransaction fragmentTransaction = getFragmentManager()
				.beginTransaction();
		MessageNavigationsBar msgNaviBar = new MessageNavigationsBar_();

		fragmentTransaction.add(R.id.sidebar, msgNaviBar);
		fragmentTransaction.commit();
	 }

	 
	 void addInboxFragment()
	 {
		 FragmentTransaction fragmentTransaction = getFragmentManager()
					.beginTransaction();
		 MessageInbox inbox = new MessageInbox_();

			Bundle bundle = new Bundle();

			inbox.setArguments(bundle);
			fragmentTransaction.replace(R.id.pane, inbox);
			fragmentTransaction.commit();
	 }
}
